FROM centos:7

RUN yum update -y && yum install -y unzip wget && yum clean all
RUN mkdir -p /u01/Oracle

ENV JAVA_HOME /usr/java/jdk1.6.0_71
ENV PATH $JAVA_HOME/bin:$PATH
ENV WM_HOME /u01/Oracle/Middleware
ENV WL_HOME /u01/Oracle/Middleware/wlserver_10.3

ADD ./silent.xml /
RUN cd /tmp && curl -o java-weblogic.tar.gz http://192.168.99.205/source/java-weblogic.tar.gz && \
    cd /tmp && tar -zxvf java-weblogic.tar.gz && cd /tmp && cp -r ./java /usr/ && \  
    cd /tmp &&curl -o wls1036_generic.jar http://192.168.99.205/source/wls1036_generic.jar && \
    cd /tmp && java -jar wls1036_generic.jar -mode=silent -silent_xml=/silent.xml && \
    mkdir /tmp/patch && cd /tmp/patch && curl -o p16083651_1036_Generic.zip http://192.168.99.205/source/p16083651_1036_Generic.zip && unzip p16083651_1036_Generic.zip &&\
    java -jar /u01/Oracle/Middleware/utils/bsu/patch-client.jar -install -patch_download_dir=/tmp/p16083651_1036_Generic -patchlist=D33T -prod_dir=/u01/Oracle/Middleware/wlserver_10.3 && \
    rm -rf /tmp/*
